<template>
  <div>
    <h3>elmenent 使用</h3>
    <el-button round>圆角按钮</el-button>
    <el-button type="primary" round>主要按钮</el-button>
    <el-button type="success" round>成功按钮</el-button>
    <el-button type="info" round>信息按钮</el-button>
    <el-button type="warning" round>警告按钮</el-button>
    <el-button type="danger" round>危险按钮</el-button>

    <h3>input使用</h3>
    <el-form ref="from">
      <el-form-item>
        <el-input placeholder="用户名" v-model="user"></el-input>
      </el-form-item>
      <el-form-item>
        <el-input placeholder="密码" v-model="psw" show-password></el-input>
      </el-form-item>
    </el-form>

    <h3>from使用</h3>
    <el-form ref="form" :model="form" :rules="rules" label-width="100px">
      <el-form-item prop="User">
        <el-input
          prefix-icon="el-icon-user-solid"
          placeholder="用户名"
          v-model="form.User"
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-input
          prefix-icon="el-icon-lock"
          placeholder="密码"
          v-model="form.password"
          show-password
        ></el-input>
      </el-form-item>
      <el-form-item>
        <el-button style="width:100%" type="primary">登录</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'useElement',
  data () {
    return {
      user: '',
      psw: '',
      form: {
        User: '',
        username: '',
        password: ''
      },
      rules: {
        User: [
          { required: true, message: '请输入手机号', trigger: 'blur' },
          { min: 3, max: 5, message: '长度在 3 到 5 个字符', trigger: 'blur' }
        ]
      }
    }
  }
}
</script>

<style></style>
